<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/Public/Admin/css/bootstrap.min.css">

</head>
<body style="margin-left: 50px;">
<h2>添加商品</h2>
<form action="" method="post" enctype="multipart/form-data" >
    <input type="hidden" name="id" value="<?php echo ($data["id"]); ?>"/>
    <table border="1">

        <tr>
            <td>商品名称：</td>
            <td><input type="text" name="gname" class="form-control" value="<?php echo ($data["gname"]); ?>" required></td>
        </tr>
        <tr>
            <td>商品分类：</td>
            <td><select name="c_id" class="form-control">
                <?php if(is_array($cate)): $i = 0; $__LIST__ = $cate;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vol): $mod = ($i % 2 );++$i;?><option <?php if($data["c_id"] == $vol["id"]): ?>selected="selected"<?php endif; ?>value="<?php echo ($vol["id"]); ?>"
                    >
                        <?php echo ($vol["cname"]); ?>
                    </option><?php endforeach; endif; else: echo "" ;endif; ?>


            </select></td>
        </tr>
        <tr>
            <td>商品状态：</td>
            <td><select name="is_show" class="form-control">
                <option value="1" <?php if($data["is_show"] == 1): ?>selected="selected"<?php endif; ?> >已上架</option>
                <option value="0" <?php if($data["is_show"] == 0): ?>selected="selected"<?php endif; ?>>下架</option>
            </select></td>
        </tr>
        <tr>
            <td>商品货号：</td>
            <td><input type="text" name="ghh" class="form-control"  value="<?php echo ($data["ghh"]); ?>" required></td>
        </tr>
        <tr>
            <td>商品数量：</td>
            <td><input type="text" name="gnum" class="form-control"value="<?php echo ($data["gnum"]); ?>" required></td>
        </tr>
        <tr>
            <td>市场价：</td>
            <td><input type="text" name="gscj" class="form-control" value="<?php echo ($data["gscj"]); ?>"required></td>
        </tr>
        <tr>
            <td>商城价：</td>
            <td><input type="text" name="gwzj"  class="form-control" value="<?php echo ($data["gwzj"]); ?>"required></td>
        </tr>
        <tr>
            <td>商品描述：</td>
            <td><textarea rows="10" cols="110" name="gdesc"  required><?php echo ($data["gdesc"]); ?></textarea></td>
        </tr>
        <tr>
            <td>商品图片：</td>
            <td><input type="file" name="gimg"><img src="<?php echo ($data["gimg"]); ?>"/> </td>
        </tr>

    </table>

    <div style="padding-top: 10px">
        <input type="submit" value="发布" class="btn btn-primary">
        <input type="reset" value="重置" class="btn btn-primary">
    </div>

</form>
</body>
</html>